Creating an Extract Report
Introduction
An Extract Report is designed to create output files that meet pre-defined specifications. This feature is especially useful for creating delimited output that is more complex than a simple comma-separated file (CSV), for creating a fixed-width file in which each field is precisely positioned on a given line, or for creating an XML file. This could include files that you might upload to a government agency, clearinghouse, or service bureau.
Extract Reports are somewhat similar in design to a Banded Report. Similar to bands within a Banded Report, an Extract Report has sections, each of which can include different data fields. However, in an Extract Report you can loop through as many datasets as your report requires, and you can precisely control the position of your data in the output file.
Unlike a Banded Report, there is no concept of a “page” in an Extract Report. Data is simply streamed into an output file.
Available report formats:
- Fixed:the width of each field is a user defined fixed value.
- Delimited: the width of each field is variable with each field separated by a user defined delimiter.
- XML: report output is in XML format.
Sections in the Extract Report
The output file from an Extract report is organized by sections. You can add as many sections as you like to the Extract Report design. The definition of each type of section is as follows:
- Title - Always appears as the first section in the report. This section contains data obtained only from the current record of each dataset referenced by the section. Looping through the datasets to obtain data is not done for this section as only data from the current record of each dataset is obtained.
- Detail – Used to loop through an associated dataset. Within this section, Argos will create one detail row for each record in the associated dataset. This is useful if you wish to create a list of vendors, for example.
You can create multiple Detail sections in an output file. You might have one simply follow another. For example, if you wanted a list of all regular checks, followed by a list of all voided checks, you would simply add a pair of Detail sections. Each Detail section is associated with its own dataset, and can be formatted however you require.
Another option is to make a Detail section a “parent” of a subsequent Detail section (referred to as the Sub-Detail section). For each record that is output in the parent Detail section, the Sub-Detail section will be executed and added to the file as well. In the vendor example from above, the vendor would be in the parent Detail section, with a list of invoices in the Sub-Detail section. You can have multiple “levels” of Sub-Detail sections. Like a Banded Report, using Sub-Detail sections in an Extract Report can significantly impact the amount of time needed to generate the report. Use this technique only if Headers and Footers (below) do not meet your requirements.
- Header – A Header section is associated with a Detail section, and is used to group the Detail data by a selected field or expression. The Header section will print once anytime the value of the group-by expression changes. For example, if your data is organized by year, and you need a header row at the beginning of each year, you should add a Header section, grouped by year. Make sure your dataset is sorted by the fields you wish to group by. As an option, you can exclude the group-by field which will cause Argos to print a single group Header (and Footer if it exists).
- Child – These sections will print directly after their parent section. They are not associated with a dataset, so any fields you add to a Child section will reflect whatever the current value of that dataset is. For example, in the vendor example, if you wanted to output each vendor, with the name on the first line, and the mailing address on the line just below, a Child section could be used.
- Footer – A Footer section is always associated with a Header section. Each Header prints before a Detail section and its associated Footer will print just after the last record of the Detail section.
- Summary - Always appears as the last section in the report. This section contains data obtained only from the current record of each dataset referenced by the section. Looping through the datasets to obtain data is not done for this section as only data from the current record of each dataset is obtained. A child section can be placed beneath a Summary section if necessary.